<div class="public-random">
    <nz-collapseset>
        <nz-collapse [nzTitle]="'查询'" [nzActive]="true" [nzDisabled]="false">
            <form nz-form [nzLayout]="'inline'">
                <div style="margin-bottom: 12px" nz-row>
                    <div nz-form-label nz-col [nzSpan]="2">
                        <label>抽查主题</label>
                    </div>
                    <div nz-form-control nz-col [nzSpan]="4">
                        <nz-input [(ngModel)]="publicRandomBean.prName" name="prName">
                        </nz-input>
                    </div>

                    <div nz-form-label nz-col [nzSpan]="3">
                      <label>创建时间</label>
                    </div>
                    <div nz-form-control nz-col [nzSpan]="8">
                      <nz-datepicker [nzSize]="'large'" [nzFormat]="'YYYY-MM-DD'" [(ngModel)]="publicRandomBean.pStartDtShow"
                                     name="pStartDtShow" [nzPlaceHolder]="'开始日期'"></nz-datepicker>
                      至
                      <nz-datepicker [nzSize]="'large'" [nzFormat]="'YYYY-MM-DD'" [(ngModel)]="publicRandomBean.pEndDtShow"
                                     name="pEndDtShow" [nzPlaceHolder]="'结束日期'"></nz-datepicker>
                    </div>
                    <button nz-button  [nzSize]="'large'" [nzType]="'primary'"
                        (click)="query()">查询</button>
                </div>
            </form>
        </nz-collapse>
    </nz-collapseset>
    <ul nz-menu [nzMode]="'horizontal'">
        <li nz-menu-item (click)="add(title, content, footer)">
            <i class="anticon anticon-plus"></i>添加
        </li>
        <li nz-menu-item (click)="update(title, content, footer)">
            <i class="anticon anticon-copy"></i>修改
        </li>
        <li nz-menu-item (click)="delete()">
            <i class="anticon anticon-delete"></i>删除
        </li>
    </ul>
    <nz-table #nzTable [nzDataSource]="list" nzSize="middle" [nzBordered]="true" [nzIsPagination]="false"
        (nzDataChange)="displayDataChange($event)">
        <thead nz-thead>
            <tr>
                <th nz-th [nzCheckbox]="true">
                    <label nz-checkbox [(ngModel)]="allChecked" [nzIndeterminate]="indeterminate" (ngModelChange)="checkAll($event)">
                    </label>
                </th>
                <th nz-th>
                    <span>抽查主题</span>
                </th>
                <th nz-th>
                    <span>创建单位</span>
                </th>
                <th nz-th>
                    <span>创建时间</span>
                </th>
                <th nz-th>
                    <span>是否结束</span>
                </th>
                <th nz-th>
                    <span>双随机</span>
                </th>
                <!--<th nz-th>
                    <span>导出结果清单</span>
                </th>-->
            </tr>
        </thead>
        <tbody nz-tbody>
            <tr nz-tbody-tr *ngFor="let data of list">
                <td nz-td [nzCheckbox]="true">
                    <label nz-checkbox [nzDisabled]="data.disabled" [(ngModel)]="data.checked" (ngModelChange)="refreshStatus($event)">
                    </label>
                </td>
                <td nz-td>{{data.prName}}</td>
                <td nz-td>{{data.prPartyName}}</td>
                <td nz-td>{{data.createdTime | timeTrans}}</td>
                <td nz-td>{{data.finish=="1"?"完成":"未完成"}}</td>
                <td nz-td>
                    <button [disabled]="data.finish=='1'" (click)="gotoSelect(data)" nz-button [nzSize]="'small'"
                        [nzType]="'primary'">抽取</button>
                </td>
                <!--<td nz-td>
                    <button [disabled]="data.finish!='1'" (click)="exportData(data)" nz-button [nzSize]="'small'"
                        [nzType]="'primary'">导出</button>
                </td>-->
            </tr>
        </tbody>
    </nz-table>

    <nz-pagination [nzPageIndex]="publicRandomBean.currentPage" nzShowTotal [nzTotal]="total" nzShowSizeChanger
        (nzPageSizeChange)="nzPageSizeChange($event)" (nzPageIndexChange)="nzPageIndexChange($event)"
        (nzPageIndexClickChange)="nzPageIndexClickChange($event)" [nzPageSize]="publicRandomBean.pageSize"></nz-pagination>


    <ng-template #title>
        <span>{{modelTitle}}</span>
    </ng-template>
    <ng-template #content>

        <public-random-add *ngIf="modal==0" (outPut)="addOutPut($event)"></public-random-add>
        <public-random-mod *ngIf="modal==1" [inValue]="updateData" (outPut)="addOutPut($event)"></public-random-mod>
    </ng-template>
    <ng-template #footer>
        <div>
        </div>
    </ng-template>


    <ng-template #title1>
        <span>请选择电梯安全日常监督检查计划</span>
    </ng-template>
    <ng-template #content1>
        <div>
            导入计划明细：
            <nz-upload nzAction="{{config.IP+config.API.uploadPlanDetail}}" [nzData]="inDictData" (nzChange)="uploadChage($event)"
                [nzShowUploadList]="false">
                <button nz-button>
                    <i class="anticon anticon-upload"></i>
                    <span>导入</span>
                </button>
            </nz-upload>
        </div>
    </ng-template>
    <ng-template #footer1>
        <div>
        </div>
    </ng-template>



</div>
